package edu.cicese.alz;

import org.openstreetmap.osmosis.core.domain.v0_6.Node;
import org.openstreetmap.travelingsalesman.routing.Route;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by: Eduardo Quintana Contreras
 * Date: 1/02/12
 * Time: 03:50 PM
 */
public class URoute {
//	private MapMarkerDot startingNode;
//	private ArrayList<MapMarkerDot> nodes;

	private Route route;
	private List<Route> routes = new ArrayList<>();

	private Node startNode;
	private Node endNode;

	private int startLocationID = -1;
	private int endLocationID = 0;

	public Route getRoute() {
		return route;
	}

	public void addRoute(Route route) {
		if (route != null) {
			routes.add(route);
		}
	}

	public void combine() {
		if (!routes.isEmpty()) {
			route = Route.combine(routes);
	//		startNode = route.getStartNode();
			endNode = route.getRoutingSteps().get(route.getRoutingSteps().size() - 1).getEndNode();
		}
	}

	public void setStartLocationID(int startLocationID) {
		this.startLocationID = startLocationID;
	}

	public void setEndLocationID(int endLocationID) {
		this.endLocationID = endLocationID;
	}

	public int getStartLocationID() {
		return startLocationID;
	}

	public int getEndLocationID() {
		return endLocationID;
	}

	public void setStartNode(Node startNode) {
		this.startNode = startNode;
	}
}
